package com.xrz.sxm.aj.activity;

import android.widget.ExpandableListView;
import android.widget.ExpandableListView.OnGroupCollapseListener;
import android.widget.ExpandableListView.OnGroupExpandListener;

import com.lidroid.xutils.view.annotation.ViewInject;
import com.xrz.sxm.aj.adapter.Adapter_Exap;
import com.xrz.sxm.aj.base.BaseAct;

public class About_ChanpinActivity extends BaseAct {

	@ViewInject(R.id.exlistview)
	private ExpandableListView m_ExpandableListView;

	private Adapter_Exap m_Adapter_Exap;

	@Override
	protected int setView() {
		return R.layout.layout_about_chanpin;
	}

	@Override
	protected void init() {
		m_Adapter_Exap = new Adapter_Exap(ctx);
		m_ExpandableListView.setAdapter(m_Adapter_Exap);
		m_ExpandableListView
				.setOnGroupExpandListener(new OnGroupExpandListener() {

					@Override
					public void onGroupExpand(int arg0) {
						try{
							for (int i = 0; i < m_Adapter_Exap.getGroupCount(); i++) {
								if (i != arg0
										&& m_ExpandableListView.isGroupExpanded(i)) {
									m_ExpandableListView.collapseGroup(i);
								}
							}
						}catch (Exception e){}
					}
				});
		m_ExpandableListView
				.setOnGroupCollapseListener(new OnGroupCollapseListener() {

					@Override
					public void onGroupCollapse(int arg0) {
						// TODO Auto-generated method stub
					}
				});
	}

	@Override
	protected String setTopTitle() {
		return null;
	}

	@Override
	protected boolean topHide() {
		return true;
	}
}
